﻿var OldSelectMenu=null;
var WorkPath="";
var timeID;
function SelectMenu(element)
{
	if(OldSelectMenu!=null)
	{
		OldSelectMenu.setAttribute("Selected","false");
		OldSelectMenu.className=""
		OldSelectMenu.rows[0].cells[1].style.borderTop="0";
		OldSelectMenu.rows[0].cells[1].style.borderBottom="0";
		OldSelectMenu.rows[0].cells[1].style.backgroundImage="url()";
		OldSelectMenu.rows[0].cells[0].children(0).src=WorkPath+"button_left.gif";
		OldSelectMenu.rows[0].cells[2].children(0).src=WorkPath+"button_left.gif";
	}
	OldSelectMenu=element;
} 

function ChangeURL(url)
{	
	if(url=="")
		url="about:blank";
	ButtonMenuFrame.document.location.replace(url);
	ResizeFrame();
}

function InitSelect()
{
	var control=document.getElementsByTagName("TABLE");
	for(i=0;i<control.length;i++)
	{
		if(control[i].id.indexOf("ButtonMenu")>=0 && control[i].getAttribute("Selected")=="true")
		{
			control[i].click()
			break;
		}
	}
}
function ResizeFrame()
{
	try
	{
		if(ButtonMenuFrame.document.readyState=="complete")
		{
			FrameTD.style.height=ButtonMenuFrame.document.body.scrollHeight+7;
			clearTimeout(timeID);
		}
		else
		{
			timeID=setTimeout("ResizeFrame()",1000);
		}
	}
	catch(e)
	{}
}
